import 'package:flutter/material.dart';

class Counter with ChangeNotifier {
  int _count = 1; //状态
  Counter() {//构造函数赋初始值
    this._count = 10;
  }
  int get count => _count; //获取状态

  incCount() {
    //更新状态
    this._count++;
    notifyListeners(); //表示更新状态,只要执行了 这个就会重新buildcart页面的build
  }
}
